﻿/**	critical_section.h
 *	----	Create Time Stamp	--2005-11-01 00:05:54--
 *-----------------------------------------------------------------------------
 *	Mean	:临界区对象
 *	Author	:Nick Shallery	(nicknide@gmail.com)
 *	Version	:1.0.15.19	(2008-08-04 02:04:40)
 *-----------------------------------------------------------------------------
**/	/*YOU HAVE ALL LEFT WITH THIS CODE WHILE YOU KEEP COMMENT IN EVERY COPY.*/


#if			!defined(__LOLIX__LOLI__CRITICAL_SECTION__K_IN_G__)
#define		__LOLIX__LOLI__CRITICAL_SECTION__K_IN_G__

#if			defined(__cplusplus)

#if			!defined(__LOLIX__TOY__REBIND_TYPE__K_IN_G__)
	#include	"../toy/rebind_type.hpp"
#endif	//	!defined(__LOLIX__TOY__REBIND_TYPE__K_IN_G__)

#if			!defined(__LOLIX__LOLIX_TYPE__K_IN_G__)
	#include	"../lolix_type.h"
#endif	//	!defined(__LOLIX__LOLIX_TYPE__K_IN_G__)

#if			!defined(__LOLIX__TOY__TIME_TYPES__K_IN_G__)
	#include	"../toy/time_types.h"
#endif	//	!defined(__LOLIX__TOY__TIME_TYPES__K_IN_G__)

#if			!defined(__LOLIX__TOY__L_X_ASSERT_NICK__K_IN_G__)
	#include	"../toy/lx_assert.h"
#endif	//	!defined(__LOLIX__TOY__L_X_ASSERT_NICK__K_IN_G__)

namespace lolix{
	namespace loli{
		class	LOLIX_NO_VTABLE	critical_section;
	}
}

class LOLIX_NO_VTABLE lolix::loli::critical_section
	: public lolix::itf
{
public:
	LOLIX_DEFINE_FACTORY((0xf4ec27c2, 0xa479d93e, 0x4edcbffa, 0xf5920d39), (critical_section** out_ptr, const wchar_t* name));
	LOLIX_DECLARE_ITF(lolix::loli::critical_section, lolix::itf, (0x3e7c6d19, 0xa45646cf, 0x90ab74ee, 0xdb320e91));
	__LOLIX_INTERFACE(enter,	LOLIX_RETNV,	(void));
	__LOLIX_INTERFACE(leave,	LOLIX_RETNV,	(void));
	__LOLIX_INTERFACE(try_enter,LOLIX_RETNV,	(bool* const is_enter));
};

SYS_REGIST_TYPE(::lolix::loli::critical_section);
SYS_REGIST_TYPE(::lolix::loli::critical_section::factory_type);

#endif	//	defined(__cplusplus)
#endif	//	!defined(__LOLIX__LOLI__CRITICAL_SECTION__K_IN_G__)
